package ali;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main1 {
    public static void main(String[] args) throws IOException {

        BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
        String[] s1 = bf.readLine().split(" ");
        int n = Integer.parseInt(s1[0]);
        int k = Integer.parseInt(s1[1]);
        String[] s = bf.readLine().split(" ");
        int[] num = new int[n];
        for (int i = 0; i < n; i++) {
            num[i] = Integer.parseInt(s[i]);
        }

        int res = 0;
        for (int i = 1; i <= k ; i++) {
            int i1 = get(num, i);
            System.out.println(i1);
            res += i1;
        }
        res++;
        System.out.println((int)(res % (Math.pow(2,61)-1)));
    }

    public static int get(int[] num,int k){
        int n = num.length;
        int[][] dp = new int[n+1][n+1];  // 在前n个中选择长度为k的上升序列的个数
        for (int i = 1; i < n; i++) {
            dp[i][1] = 1;
        }
        for (int i = 2; i <= n; i++) {
            for (int j = 2; j <= n ; j++) {
                for (int l = 1; l < j; l++) {
                    if(num[j-1] > num[l-1]) {
                        dp[j][i] = (int) ((dp[j][i] + dp[l][i-1]) % (Math.pow(2,61)-1));
                    }
                }
            }
        }
        int res = 0;
        for (int i = 1; i <= n ; i++) {
            res += dp[i][k];
        }
        return res;
    }
}
